﻿using NetWing.Common.Data.SqlServer;
using NetWing.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace NetWing.BPM.Admin.JydWodrmb
{
    public partial class plprint_printshqsd : System.Web.UI.Page
    {

        protected string OrderID;
        protected string comname;
        protected string connman;
        protected string tel;
        protected string adddate;
        protected string deliveryDate;
        protected string jjy;
        protected string ywy;
        protected string explain;
        protected string huofa;
        protected string ys;
        protected string jedx;
        protected string jexx;
        protected string yufuk;
        protected string yufukuana;

        protected string fumoa;
        protected string fumob;
        protected string tana;
        protected string tanb;
        protected string uva;
        protected string uvb;
        protected string yaa;
        protected string yab;
        protected string db;
        protected string sh;
        protected string zheye;
        protected string zd;
        protected string bh;
        protected string sk;
        protected string dda;
        protected string ddb;
        protected string dddd;
        protected string dddda;
        protected string ddddb;
        protected string printtype;
        protected string aaaaa;



        protected string sl;
        protected string dj;
        protected string je;
        protected string shslo;

        protected JydOrderModel model;
        protected JydOrderDetailModel model1;
        protected string bzhua;
        public DataTable dt = null;
        public DataTable dt1 = null;
        public DataTable dte = null;
        public DataTable dtu = null;

        public string did;
        public DataTable dataTable;
        protected void Page_Load(object sender, EventArgs e)
        {
            string pid = Request["KeyId"];//主表ID
            string dateii = Request["OrderID"];//orderid
            aaaaa = Request["aaaaa"];//输入发货数量
            string songhuos = Request["songhuos"];
            bzhua = Request["bzhua"];
            string id = Request["id"];
            did = Request["did"];
            string yspmc = Request["yspmc"];
            string sql1 = "select * from jydOrderDetail where  orderid='" + dateii + "'";//明细表

            string sql = "select * from jydOrderDetailSH left join jydOrderDetail on jydOrderDetailSH.KeyId=jydOrderDetail.KeyId where jydOrderDetailSH.id  in (" + Request["did"] + ")";//明细表

            string sqle = "select * from jydOrder where OrderID='" + dateii + "' and KeyId=" + pid;
            string sqlu = "select * from  jydOrderDetailSH where Orderid='" + dateii + "' and songhuos='" + songhuos + "'";
            dt = SqlEasy.ExecuteDataTable(sql);
            dt1 = SqlEasy.ExecuteDataTable(sql1);
            dte = SqlEasy.ExecuteDataTable(sqle);
            dtu = SqlEasy.ExecuteDataTable(sqlu);
            string shname = "";
            foreach (DataRow dr in dte.Rows)
            {
                shname += dr["OrderID"].ToString() + ",";
            }
            shname = shname.Substring(0, shname.Length - 1);

            model = new JydOrderModel();
            model1 = new JydOrderDetailModel();

            if (dte.Rows.Count > 0)
            {
                model.OrderID = dte.Rows[0]["OrderID"].ToString();
                model.comname = dte.Rows[0]["comname"].ToString();
                model.connman = dte.Rows[0]["connman"].ToString();
                model.tel = dte.Rows[0]["tel"].ToString();
                adddate = dte.Rows[0]["adddate"].ToString();
                deliveryDate = dte.Rows[0]["deliveryDate"].ToString();
                model.jjy = dte.Rows[0]["jjy"].ToString();
                model.ywy = dte.Rows[0]["ywy"].ToString();
                model.explain = dte.Rows[0]["explain"].ToString();
                model.huofa = dte.Rows[0]["huofa"].ToString();
                model.ys = dte.Rows[0]["ys"].ToString();
                model.jedx = dte.Rows[0]["jedx"].ToString();
                jexx = dte.Rows[0]["jexx"].ToString();
                yufuk = dte.Rows[0]["yufuk"].ToString();
                model.yufukuana = dte.Rows[0]["yufukuana"].ToString();

                OrderID = model.OrderID;
                comname = model.comname;
                connman = model.connman;
                tel = model.tel;
                jjy = model.jjy;
                ywy = model.ywy;
                explain = model.explain;
                huofa = model.huofa;
                ys = model.ys;
                jedx = model.jedx;
                jedx = model.jedx;
                yufukuana = model.yufukuana;

            }
            else
            {

            }


            if (dt1.Rows.Count > 0)
            {













                fumoa = dt1.Rows[0]["fumoa"].ToString();
                fumob = dt1.Rows[0]["fumob"].ToString();
                tana = dt1.Rows[0]["tana"].ToString();
                tanb = dt1.Rows[0]["tanb"].ToString();
                uva = dt1.Rows[0]["uva"].ToString();
                uvb = dt1.Rows[0]["uvb"].ToString();
                yaa = dt1.Rows[0]["yaa"].ToString();
                yab = dt1.Rows[0]["yab"].ToString();
                db = dt1.Rows[0]["db"].ToString();
                sh = dt1.Rows[0]["sh"].ToString();
                zheye = dt1.Rows[0]["zheye"].ToString();
                zd = dt1.Rows[0]["zd"].ToString();
                bh = dt1.Rows[0]["bh"].ToString();
                sk = dt1.Rows[0]["sk"].ToString();
                //dda = dt.Rows[0]["dddda"].ToString();
                //ddb = dt.Rows[0]["ddddb"].ToString();
                dddd = dt1.Rows[0]["dddd"].ToString();
                printtype = dt1.Rows[0]["PrintType"].ToString();
                sl = dt1.Rows[0]["sl"].ToString();
                dj = dt1.Rows[0]["dj"].ToString();
            }
            else
            {
            }
    }
}
}